// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
// Licensed under the MIT License (the "License"); you may not use this file except in 
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
// Unless required by applicable law or agreed to in writing, software distributed under the License is
// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions and
// limitations under the License.
/*
 * appender-swift-bridge.h
 *
 *  Created on: 2017-1-3
 *      Author: Jinkey
 */


#include <stdio.h>
#import <Foundation/Foundation.h>
//#import "LogUtil.h"
//#import <mars/xlog/xloggerbase.h>


typedef enum {
    TT_kLevelAll = 0,
    TT_kLevelVerbose = 0,
    TT_kLevelDebug,    // Detailed information on the flow through the system.
    TT_kLevelInfo,     // Interesting runtime events (startup/shutdown), should be conservative and keep to a minimum.
    TT_kLevelWarn,     // Other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
    TT_kLevelError,    // Other runtime errors or unexpected conditions.
    TT_kLevelFatal,    // Severe errors that cause premature termination.
    TT_kLevelNone,     // Special level used to disable all log messages.
} TTLogLevel;


typedef NS_ENUM(NSUInteger, XloggerType) {
    all = TT_kLevelAll,
    verbose = TT_kLevelVerbose,
    debug = TT_kLevelDebug,
    info = TT_kLevelInfo,
    warning = TT_kLevelWarn,
    error = TT_kLevelError,
    fatal = TT_kLevelFatal,
    none = TT_kLevelNone

};




@interface JinkeyMarsBridge: NSObject

typedef void (^QWLogAllLogCallBack)(TTLogLevel level,NSString * _Nonnull log);

@property (nonatomic,copy) NSString *key;

- (void)initXlogger: (XloggerType)debugLevel releaseLevel: (XloggerType)releaseLevel path: (NSString*)path prefix: (const char*)prefix key:(const char*)key;
- (void)deinitXlogger;

+(void) log: (XloggerType) level tag:(NSString *)tag message: (NSString*)message;

+ (void)appenderFlush:(BOOL)flush;

+ (void)verbose:(NSString *_Nullable)tag msg:(NSString * _Nonnull )format, ...NS_FORMAT_FUNCTION(2, 3);

+ (void)debug:(NSString *_Nullable)tag msg:(NSString * _Nonnull )format, ...NS_FORMAT_FUNCTION(2, 3);

+ (void)info:(NSString *_Nullable)tag msg:(NSString * _Nonnull )format, ...NS_FORMAT_FUNCTION(2, 3);

+ (void)warn:(NSString *_Nullable)tag msg:(NSString * _Nonnull )format, ...NS_FORMAT_FUNCTION(2, 3);

+ (void)error:(NSString *_Nullable)tag msg:(NSString * _Nonnull )format, ...NS_FORMAT_FUNCTION(2, 3);


+ (void)info:(NSString *_Nullable)tag message:(NSString* _Nonnull )message;

+ (void)debug:(NSString *_Nullable)tag message:(NSString* _Nonnull )message;

+ (void)warn:(NSString *_Nullable)tag message:(NSString* _Nonnull )message;

+ (void)error:(NSString *_Nullable)tag message:(NSString* _Nonnull )message;

+ (void)verbose:(NSString *_Nullable)tag message:(NSString* _Nonnull )message;

@end


